<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="TreeListView" Namespace="Home.ServerControls" TagPrefix="Home" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<link rel="stylesheet" href="StyleSheet.css" />
<title>TreeListView Control Test Page</title>
<script type="text/javascript">
function onCheckNode(obj)
{
    //alert(obj.id.replace("ckb_",""));
    gid("msg").innerHTML="You click:"+obj.id.replace("ckb_","");
    return true;
}
function GetCheckedNodes() 
{
    var list = gid("tree").getElementsByTagName("input");
    var result = new Array();
    for(var i=0;i<list.length;i++)
    {
        if (list[i].checked)
        {
        result.push(list[i].id.replace("ckb_",""));
        }
    }
    alert(result.join(","));
}
function onHeadTdClick(td)
{
    alert(td.innerHTML);
}
function onMouseOut(obj)
{
    obj.style.backgroundColor="";
}
function onMouseOver(obj)
{
    obj.style.backgroundColor="#cccccc";
}
function CheckAll(obj)
{
    var list = gid("tree").getElementsByTagName("input");
    var result = new Array();
    for(var i=0;i<list.length;i++)
    {
        list[i].checked=obj.checked;
        
    }
}
</script>

</head>
<body style="padding:10px;">
<form id="form1" runat="server">
<div >
<Home:TreeListView ID="tree" runat="server" />
    <br />
    <br />
    <asp:CheckBox ID="ckbShowTreeLine" runat="server" AutoPostBack="True" Checked="true" Text="Show Tree Line" />
    <asp:CheckBox ID="ckbShowCheckBox" runat="server" AutoPostBack="True" Checked="true" Text="Show Check Box" /><br />
    <br />
<asp:Button ID="Button1" runat="server" Text="GetCheckedNodes" OnClientClick="GetCheckedNodes();return false;" />
<br /><br />
<span id='msg' style="color:Red;"></span>
</div>

<br />
<br />
<br />
<br />

</form>
</body>
</html>